General-purpose macro processor
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
top
A general-purpose macro processor or general purpose preprocessor is a macro processor that is not tied to or integrated with a particular language or piece of software.
A macro processor is a program that copies a stream of text from one place to another, making a systematic set of replacements as it does so. Macro processors are often embedded in other programs, such as assemblers and compilers. Sometimes they are standalone programs that can be used to process any kind of text.
Macro processors have been used for language expansion (defining new language constructs that can be expressed in terms of existing language components), for systematic text replacements that require decision making, and for text reformatting (e.g. conditional extraction of material from an HTML file).
Contents
β’ See also
β’ References
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Examples of general purpose macro processors
| Name | Year | Description |
|---|---|---|
| GPM | 1960s | One of the earliest macro processors wa⦠|
| ML/I | 1960s | One particularly important general purp⦠|
| STAGE2 | 1960s | A contemporary of ML/I was STAGE2, part⦠|
| M6 | 1960s | Early macro processor developed at AT&T⦠|
| SNOBOL | 1960s | SNOBOL is a string processing language⦠|
| XPOP | | XPOP was another attempt at a general m⦠|
| TTM | 1968 | TTM is a recursive, interpretive langua⦠|
| GMP | 1970s | Another attempt was the GMP (General Ma⦠|
| M4 | 1977 | m4 was designed and written in C for Un⦠|
| ELENA | | Software: Practice and Experience , Vol⦠|
| gema | 1995 | gema is a contextual macro processor ba⦠|
| GPP | 1996 | gpp is another general macro processor⦠|
| M5 | 1999 | m5 is a general-purpose macro processor⦠|
| pyexpander | 2011 | pyexpander is a general-purpose macro p⦠|
| Text Assembler | 2014 | Text Assembler is a general-purpose tex⦠|
| PP | 2016 | PP is a text preprocessor designed for⦠|
| minimac | | minimac is a minimalist general purpose⦠|
| aa_macro | 2017 | aa_macro is an open-source character-st⦠|
See also
References
cite-note-gpm-11. citerefstrachey1965Strachey, Christopher (October 1965). "A General Purpose Macrogenerator". Computer Journal. 8 (3): 225β241. doi:10.1093/comjnl/8.3.225.
cite-note-22. citerefwaite1970Waite, William M. (July 1970). "The mobile programming system: STAGE2". Communications of the ACM. 13 (7). New York, NY, USA: ACM: 415β421. doi:10.1145/362686.362691.
cite-note-33. citerefbritten2020Britten, Charles Randyl (2020-06-26). "Translation of 8080 Code to 8086 - Microsoft Translation of 8080 Code to 8086 and Other 16-Bit Processors". Archived from the original on 2021-07-23. Retrieved 2021-11-28. Stage2 was created by Prof William Waite at the University of Colorado in the late sixties as a major component of his mobile programming system, MPS. Stage2 uses a pattern matching algorithm to match input lines of text against a set of templates. Each template is the first line of a macro and when a match is recognized the code body of that macro is processed to produce output text, error messages, or create a constructed line that is submitted for further template matching. So the process is fully recursive and quite powerful in its capabilities for text transformation. In fact, it can be used to implement a programming language compiler.
cite-note-44. citerefcole1981Cole, A. J. (1981). Macro Processors (2nd, revised ed.). CUP Archive. p. 254.
cite-note-gap-55. Farber, D. J., 635 Assembly System - GAP. Bell Telephone Laboratories Computation Center (1964).
cite-note-66. citerefkernighanplauger1976Kernighan, Brian W.; Plauger, P. J. (1976). Software Tools. Reading, Masschusetts: Addison-Wesley. p. 283. ISBN 0-201-03669-X.
cite-note-77. "Gema". gema.sourceforge.net. Retrieved 2017-04-21.
cite-note-88. "GPP". logological.org/gpp. Retrieved April 21, 2017.
cite-note-99. "akiwi - Text Assembler". www.akiwi.co.uk. Retrieved 2017-04-21.
cite-note-1010. citerefdelordDelord, Christophe. "PP - A generic Preprocessor (with Pandoc in mind)". cdsoft.fr. Retrieved 2017-10-17.
cite-note-1111. "minimac". freshmeat.net. Retrieved 2017-04-21.
cite-note-1212. "aa_macro". Retrieved 2017-11-24.
cite-note-1313. "wtfm". Retrieved 2017-11-24.